home *** CD-ROM | disk | FTP | other *** search
/ Pascal Super Library / Pascal Super Library (CW International)(1997).bin / MLT_TASK / PIBMDOS / PIBMTASK.PAS < prev    next >
Pascal/Delphi Source File  |  1988-06-05  |  6KB  |  110 lines

  1. UNIT PibMTask;
  2.  
  3. (*----------------------------------------------------------------------*)
  4. (*            PibMTask --- Multitasking interfaces for Turbo Pascal     *)
  5. (*----------------------------------------------------------------------*)
  6. (*                                                                      *)
  7. (*  Author:   Philip R. Burns                                           *)
  8. (*                                                                      *)
  9. (*  Version:  1.2   June, 1988.                                         *)
  10. (*                                                                      *)
  11. (*  Overview: This unit provides Turbo Pascal interfaces to several of  *)
  12. (*            the most popular multitasking programs for DOS:           *)
  13. (*                                                                      *)
  14. (*               - DesqView from QuarterDeck                            *)
  15. (*               - TaskView and OmniView from Sunny Hill Software       *)
  16. (*               - TopView from IBM                                     *)
  17. (*               - DoubleDos from SoftLogic                             *)
  18. (*                                                                      *)
  19. (*            Because MicroSoft Windows will emulate TopView, these     *)
  20. (*            routines are also useful for Windows (in text mode only). *)
  21. (*                                                                      *)
  22. (*            The include file PIBMDOS.PAS contains the actual          *)
  23. (*            interface routines.                                       *)
  24. (*                                                                      *)
  25. (*            Global variables of importance:                           *)
  26. (*                                                                      *)
  27. (*               Virtual_Screen      --- address of real screen if no   *)
  28. (*                                       multitasker running, else      *)
  29. (*                                       address of virtual screen.     *)
  30. (*               MultiTasker         --- which multitasker is active.   *)
  31. (*               TimeSharingActive   --- TRUE if multitasker is active. *)
  32. (*               Wait_For_Retrace    --- Set this TRUE if your color    *)
  33. (*                                       graphics card produces snow    *)
  34. (*                                       when screen memory is accessed *)
  35. (*                                       (e.g., set TRUE for IBM's CGA  *)
  36. (*                                       but FALSE for Zeniths and      *)
  37. (*                                       Compaqs, among others).        *)
  38. (*               Write_Screen_Memory --- TRUE to write directly to      *)
  39. (*                                       screen memory -- either the    *)
  40. (*                                       genuine screen memory or the   *)
  41. (*                                       virtual buffer for a multi-    *)
  42. (*                                       tasker.  FALSE to use the BIOS *)
  43. (*                                       instead.                       *)
  44. (*            Routines:                                                 *)
  45. (*                                                                      *)
  46. (*               IsTimeSharingActive --- Determines which multitasker,  *)
  47. (*                                       if any, is active, and sets    *)
  48. (*                                       the virtual buffer address in  *)
  49. (*                                       "Virtual_Screen."              *)
  50. (*               TurnOnTimeSharing   --- Allows time slicing to go on.  *)
  51. (*                                       You may wish to start/stop     *)
  52. (*                                       time slicing when accessing    *)
  53. (*                                       critical code.                 *)
  54. (*               TurnOffTimeSharing  --- Turns off time slicing.        *)
  55. (*               GiveUpTime          --- Gives up test of this program's*)
  56. (*                                       current time slice for use by  *)
  57. (*                                       other programs.                *)
  58. (*               Sync_Screen         --- Issues TopView synchronization *)
  59. (*                                       call required by TopView and   *)
  60. (*                                       Windows when the virtual buffer*)
  61. (*                                       is updated.                    *)
  62. (*               Sync_Entire_Screen  --- Issues TopView synchronization *)
  63. (*                                       call for entire screen.        *)
  64. (*                                                                      *)
  65. (*            I would appreciate it if anyone familiar with the other   *)
  66. (*            multitaskers for which no interface is provided would     *)
  67. (*            add the relevant code and upload a corrected copy         *)
  68. (*            for all of us to learn from.                              *)
  69. (*                                                                      *)
  70. (*----------------------------------------------------------------------*)
  71.  
  72. INTERFACE
  73.  
  74. USES
  75.    Dos, Crt, GlobScrn;
  76.  
  77. (*----------------------------------------------------------------------*)
  78. (*                       Multitasker definitions                        *)
  79. (*----------------------------------------------------------------------*)
  80.  
  81. TYPE
  82.    MultiTaskerType     = ( MultiTasker_None, DoubleDos, DesqView, TopView,
  83.                            MSWindows, APXCore, EZDosIt, Concurrent_DOS,
  84.                            TaskView, MultiLink, Other );
  85.  
  86. VAR
  87.    TimeSharingActive : BOOLEAN     (* TRUE if multitasker active        *);
  88.  
  89.                                    (* Which multitasker active          *)
  90.    MultiTasker       : MultiTaskerType;
  91.  
  92.    Virtual_Screen    : Screen_Ptr  (* Alternate display buffer address *);
  93.  
  94. (* EXPORTS *)
  95.  
  96.    FUNCTION  IsTimeSharingActive : BOOLEAN;
  97.    PROCEDURE TurnOnTimeSharing;
  98.    PROCEDURE TurnOffTimeSharing;
  99.    PROCEDURE GiveUpTime( NSlices : INTEGER );
  100.    PROCEDURE Sync_Screen( S_Pos: INTEGER; NChars : INTEGER );
  101.    PROCEDURE Sync_Entire_Screen;
  102.  
  103. IMPLEMENTATION
  104.                                    (* Ensure multitasking defined       *)
  105. {$DEFINE MTASK}
  106.                                    (* Multitasker interface routines    *)
  107. {$I PIBMDOS.PAS  }
  108.  
  109. END   (* PibMTask *).
  110.